package com.bll.imple.employAction;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bean.EmployBean;
import com.bll.Action;
import com.dao.EmployDao;

public class AddEmployAction implements Action{

	public String execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		
		System.out.println("nameFDB ZBFGNGFNB");
		
		String name=request.getParameter("name");
		String tel=request.getParameter("tel");
		String info=request.getParameter("info");
		//int userId=1;
		int userId=Integer.parseInt(request.getParameter("userId"));
		
		EmployDao dao=new EmployDao();
		EmployBean bean=new EmployBean();
		bean.setInfo(info);
		bean.setName(name);
		bean.setTel(tel);
	
		bean.setUserId(userId);
		
		int n=dao.AddEmploy(bean);
		if(n>0){
			return "cpyctjcg.jsp";
		}else{
			return "chengpinyingcaibiaodan.jsp";
		}
		
		
		
		
	}

}
